In [45]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
In [63]:
s = pd.Series([1,3,5,np.nan,6,8])
dates = pd.date_range('20130101',periods=6)
df = pd.DataFrame(np.random.randn(6,5),index=dates,columns=list('ABCDE'))
In [62]:
np.random.randn(6,4)
Out[62]:
In [30]:
df2 = pd.DataFrame({ 'A' : 1.,
'B' : pd.Timestamp('20130102'),
'C' : pd.Series(1,index=list(range(4)),dtype='float32'),
'D' : np.array([3] * 4,dtype='int32'),
'E' : 'foo' })
In [31]:
df2
Out[31]:
In [32]:
#I guess this shows where the data types are.
df2.dtypes
Out[32]:
In [64]:
df.head()
Out[64]:
In [37]:
df.index
Out[37]:
In [41]:
df.values[0][0]
Out[41]:
In [42]:
df.T
Out[42]:
In [44]:
df.sort(columns='B', ascending=False)
Out[44]:
In [48]:
df['A']
Out[48]:
In [51]:
df.loc[:,['A','B']]
Out[51]:
In [52]:
df.at[dates[0],'A']
Out[52]:
In [53]:
df.iloc[3:5,0:2]
Out[53]:
In [54]:
Out[54]:
In [57]:
df.iloc[1:3,:]
Out[57]:
In [58]:
#most efficient
df.iat[1,1]
Out[58]:
In [ ]: